package com.pair.micro.fee.modules.charge.controller;

import com.pair.micro.common.response.MicroResult;
import com.pair.micro.common.utils.PageResult;
import com.pair.micro.fee.modules.charge.query.RoomOwnerQuery;
import com.pair.micro.fee.modules.charge.service.RoomOwnerService;
import com.pair.micro.fee.modules.charge.vo.RoomOwnerVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("fx/roomOwner")
@Tag(name = "业主信息管理")
@AllArgsConstructor
public class RoomOwnerController {

    private final RoomOwnerService roomOwnerService;

    @GetMapping(value = "/page")
    @Operation(summary = "分页列表查询")
//    @PreAuthorize("hasAuthority('room:owner:list')")
    public MicroResult<PageResult<RoomOwnerVO>> page(@ParameterObject @Valid RoomOwnerQuery query){
        PageResult<RoomOwnerVO> page = roomOwnerService.page(query);
        return MicroResult.ok(page);
    }

}
